﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.SqlServer.MessageBox;
using System.Windows.Forms;

namespace Fawcett.Plugins
{
    public static  class MessageBox
    {
        public static void Show( Exception except, String str)
        {           
            ApplicationException exTop = new ApplicationException(str, except);
            
            ExceptionMessageBox box = new ExceptionMessageBox(exTop);
            box.Buttons = ExceptionMessageBoxButtons.Custom;
            box.SetButtonText( "Close" );
            box.Caption = String.Format( "Exception Caught in {0}" , except.Source );
            box.ShowCheckBox = false;
            box.ShowToolBar = true;
             
            box.Symbol = ExceptionMessageBoxSymbol.Stop;
            box.Show( null ) ;
            Application.Exit();
        }
    }
}
